package com.thrift.demo;

import org.apache.thrift.TException;
import org.apache.thrift.protocol.TBinaryProtocol;
import org.apache.thrift.protocol.TCompactProtocol;
import org.apache.thrift.transport.TSocket;
import org.apache.thrift.transport.TTransport;

/**
 * Created by lizhenxing on 2017/3/31.
 */
public class HelloServiceClient {

    public static void main(String[] args) throws TException {
        TTransport client = new TSocket("localhost",7099);
        client.open();
        TBinaryProtocol protocol = new TBinaryProtocol(client);
        TCompactProtocol compactProtocol = new TCompactProtocol(client);
        Hello.Client c = new Hello.Client(protocol);
//        User user = new User();
//        user.setUsername("lizhenxing");
//        c.sayBye(user);
//        c.sayHello();

        Student student = new Student();
        student.setUsername("lizhenxing");
        c.sayStudent(student);

    }
}
